<?php


namespace app\api\controller\manystore;


use app\common\controller\Api;
use app\common\library\Auth;
use app\common\model\manystore\Banji;
use app\common\model\manystore\Student;
use app\common\model\manystore\Teacher;
use app\manystore\model\ManystoreShop;
use think\Request;

class Base extends Api
{
    protected $shop_id = 0;
    protected $shop = null;
    protected $student = null;
    protected $teacher = null;
    protected $banji = null;


    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    public function _initialize()
    {
        #init
        parent::_initialize();

        //set dao
        $this->_init();
    }

    public function _init()
    {
        $shop_id=$this->request->header('shop_id', 0);
        $banji_id=$this->request->header('banji', 0);
        $student_id =$this->request->header('student', 0);
        $teacher_id =$this->request->header('teacher', 0);

        $this->banji = Banji::get($banji_id);

        $this->student = Student::get($student_id);
        $this->teacher = Teacher::get($teacher_id);
        $this->shop = ManystoreShop::get($shop_id);
        $this->shop_id = $shop_id;
    }
}